n_rects = cairo_region_num_rectangles (region);
+#define FLIP_Y(_y) (unscaled_window_height - (_y))
+
for (i = 0; i < n_rects; i++)
{
cairo_region_get_rectangle (region, i, &rect);
- glScissor (rect.x * window_scale, unscaled_window_height - (rect.y + rect.height) * window_scale,
+ glScissor (rect.x * window_scale, FLIP_Y ((rect.y + rect.height) * window_scale),
rect.width * window_scale, rect.height * window_scale);
e = rect;
cairo_surface_unmap_image (surface, image);
-#define FLIP_Y(_y) (unscaled_window_height - (_y))
-
if (use_texture_rectangle)
{
umax = rect.width * sx;
{
GdkTexturedQuad quad = {
- rect.x * window_scale, FLIP_Y(rect.y),
+ rect.x * window_scale, FLIP_Y(rect.y * window_scale),
(rect.x + rect.width) * window_scale, FLIP_Y((rect.y + rect.height) * window_scale),
0, 0,
umax, vmax,
cairo_rectangle_int_t rect;
int n_rects, i;
GdkWindow *window;
- int window_height;
+ int unscaled_window_height;
int window_scale;
unsigned int texture_id;
gboolean use_texture_rectangle;
window = gdk_gl_context_get_window (paint_context)->impl_window;
window_scale = gdk_window_get_scale_factor (window);
- window_height = gdk_window_get_height (window);
+ gdk_window_get_unscaled_size (window, NULL, &unscaled_window_height);
sx = sy = 1;
cairo_surface_get_device_scale (window->current_paint.surface, &sx, &sy);
n_rects = cairo_region_num_rectangles (region);
quads = g_new (GdkTexturedQuad, n_rects);
-#define FLIP_Y(_y) (window_height - (_y))
+#define FLIP_Y(_y) (unscaled_window_height - (_y))
cairo_region_get_extents (region, &rect);
- glScissor (rect.x * window_scale, FLIP_Y(rect.y) * window_scale,
- (rect.x + rect.width) * window_scale, FLIP_Y (rect.y + rect.height) * window_scale);
+ glScissor (rect.x * window_scale, FLIP_Y((rect.y + rect.height) * window_scale),
+ rect.width * window_scale, rect.height * window_scale);
for (i = 0; i < n_rects; i++)
{
{
GdkTexturedQuad quad = {
- rect.x * window_scale, FLIP_Y(rect.y) * window_scale,
- (rect.x + rect.width) * window_scale, FLIP_Y(rect.y + rect.height) * window_scale,
+ rect.x * window_scale, FLIP_Y(rect.y * window_scale),
+ (rect.x + rect.width) * window_scale, FLIP_Y((rect.y + rect.height) * window_scale),
uscale * src_x, vscale * src_y,
uscale * (src_x + src_width), vscale * (src_y + src_height),
};
#undef FLIP_Y
- glDisable (GL_SCISSOR_TEST);
-
gdk_gl_texture_quads (paint_context, target, n_rects, quads);
g_free (quads);
+ glDisable (GL_SCISSOR_TEST);
+
glXReleaseTexImageEXT (glx_pixmap->display, glx_pixmap->drawable,
GLX_FRONT_LEFT_EXT);